package day0725API;

import java.io.*;
import java.util.Scanner;

public class Test13 {
    public static void main(String[] args) {

        try(//PrintWriter pw=new PrintWriter("src/day0725API/Test13.txt");
            FileOutputStream fis=new FileOutputStream("src/day0725API/Test13.txt", true);
            OutputStreamWriter isr=new OutputStreamWriter(fis);
            BufferedWriter bw=new BufferedWriter(isr);
            PrintWriter pw=new PrintWriter(bw,true)){
            Scanner s=new Scanner(System.in);
            while(true){
                System.out.println("请输入文字： ");
                String msg=s.nextLine();
                if(msg.equals("-1")){
                    break;
                }
                pw.println(msg);
                //pw.flush();
            }
        }catch (IOException e){
            e.printStackTrace();//打印异常详细信息
        }finally {
            System.out.println("Over");
        }


    }
}
